object Test04 {
  def main(args: Array[String]): Unit = {
    val s = new student4("赵敏", 20)
    println(s"姓名: ${s.name}, 年龄: ${s.age}")
  }
}

class student4 (var name:String, var age:Int, var address:String) {
  println("student4主构造器初始化")

  // 辅助构造器
  def this(name: String, age: Int) {
    this(name, age, "")
  }
  def update(name:String, age:Int): Unit = {
    this.name = name
    this.age = age
  }
}
